<template>
    <div>
        <div class="userTop">
            <div class="userbg">
                <img src="@/assets/img/usertbg.jpg" alt="" />
                <div class="Tdz"><span>TA的照</span></div>
            </div>
            <div class="return">
                <i class="iconfont icon-fanhui left" @click="$router.push('/my')"></i>
                <i class="iconfont icon-a-shuxing1a2sandianshuxiang right"></i>
            </div>

            <div class="usercunt">
                <div class="userxx">
                    <div class="userimg">
                        <img :src="theUser.profile.avatarUrl" alt="" />
                        <h3>{{ theUser.profile.nickname }}</h3>
                    </div>
                    <div class="usernav">
                        <ul>
                            <li><span>3</span><span>关注</span></li>
                            <li><span>0</span><span>粉丝</span></li>
                            <li>
                                <span>Lv.{{ theUser.level }}</span>
                            </li>
                        </ul>
                        <div class="userAgeSex">
                            <div class="userSex"><span>广东 广州</span></div>
                            <div class="userAge"><span>村龄{{ theUser.createDays }}天</span></div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import { getTheUserDetails } from "@/api/user";
export default {
    data() {
        return {
            theUser: null,
        };
    },

    methods: {
        aa() {
            console.log(11);
        },
    },
    created() {
        // 获取用户详情
        getTheUserDetails(this.$route.query.id).then((data) => {
            this.theUser = data;
            console.log(this.theUser);
        });
    },
    mounted() { },
};
</script>

<style lang="scss" scoped>
.userTop {
    width: 100%;
    height: 100%;
    position: relative;

    .return {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        display: flex;
        z-index: 2;
        justify-content: space-between;
        padding: 10px 5px;
        color: #e1d7ca;

        i {
            font-size: 26px;
        }

        .left {}
    }
    .userbg {
        width: 100%;
        height: 350px;
        background-repeat: no-repeat;
        position: relative;
        font-size: 100%;

        &::after {
            content: " ";
            background-color: rgba(0, 0, 0, 0.25);
            position: absolute;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0;
            z-index: 1;
        }

        .Tdz {
            width: 70px;
            height: 25px;
            border-radius: 20px;
            text-align: center;
            background-color: rgba(0, 0, 0, .1);
            z-index: 4;
            position: absolute;
            bottom: 100px;
            right: 20px;
            color: #e1d7ca;
            line-height: 25px;

            span {
                font-size: 8px;
            }
        }

        img {
            width: 100%;
            height: 100%;
        }
    }

    .usercunt {
        position: absolute;
        top: 280px;
        width: 100%;
        height: 667px;
        z-index: 3;
        background-color: #f4f4f4;
        font-size: 12px;

        .userxx {
            position: absolute;
            left: 5%;
            right: 5%;
            top: -2%;
            width: 90%;
            height: 180px;
            border-radius: 8px;
            background-color: #fff;

            .userimg {
                position: absolute;
                top: -25%;
                left: 40%;
                width: 80px;
                height: 80px;
                border-radius: 50%;

                img {
                    width: 100%;
                    border-radius: 50%;
                }

                h3 {
                    text-align: center;
                    margin-top: 3px;
                    font-weight: bold;
                    color: #505050;
                }
            }

            .usernav {
                position: absolute;
                bottom: 0;
                width: 100%;
                height: 110px;

                ul {
                    display: flex;
                    //  align-items: center;
                    justify-content: center;

                    li {
                        font-size: 14px;
                        color: #a9a9a9;
                        padding: 0 5px;

                        span {
                            padding: 0 2px;
                        }
                    }
                }

                .userAgeSex {
                    display: flex;
                    justify-content: center;
                    margin-top: 15px;

                    .userSex,
                    .userAge {
                        width: 70px;
                        text-align: center;
                        height: 25px;
                        line-height: 25px;
                        border: 1px solid #ccc;
                        margin: 0 5px;
                        border-radius: 4px;
                        color: #5C5C5C;
                        font-weight: bold;
                    }

                    .userSex {}

                    .userAge {}
                }
            }
        }
    }
}
</style>